var vertx = require('vertx');
var container = require('vertx/container');

container.deployVerticle('WebClient.js');

var server = vertx.createHttpServer();

// Serve the static resources
server.requestHandler(function(req) {
//  console.log(req.uri());
  if (req.uri() == "/") req.response.sendFile("../../webroot/eventbusbridge/index.html")
  if (req.uri() == "/vertxbus.js") req.response.sendFile("../../webroot/js/vertxbus-2.1.js")
});

// Initialize the SockJS bridge
vertx.createSockJSServer(server).bridge({prefix: "/eventbus"}, [{address: 'webclient_address'}], [{}]);

server.listen(8080);